from flask import Blueprint, current_app


html = Blueprint("html", __name__)


@html.route('/<path:file_name>')
def get_html(file_name):
    """提供html静态文件"""
    # 根据用户访问路径中指定的html文件名，找到指定静态文件并返回
    # 判断如果不是网站logo
    if file_name != "favicon.ico":
        # 拼接路径
        file_name = "html/" + file_name

    return current_app.send_static_file(file_name)


# 根路由
@html.route('/')
def index():
    return current_app.send_static_file("html/index.html")

